/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.pig4cloud.pigx.contract.dto;


import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 开仓DTO
 *
 * @date 2022-08-11 10:08:11
 */
@Data
@ApiModel(value = "ContractOrderOpenDTO")
public class ContractOrderOpenDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 客户自定义订单id
     */
    @ApiModelProperty(value = "客户自定义订单id")
    @Length(min = 1, max = 200, message = "数据异常，客户自定义订单id长度应在1-200之间")
    private String clientOrderId;

    /**
     * 币对id
     */
    @ApiModelProperty(value = "币对id", required = true)
    @NotNull(message = "数据异常，symbolId为空")
    private Long symbolId;

    /**
     * 币对id
     */
    @ApiModelProperty(value = "币对名称", required = true)
    private String symbolName;

    /**
     * 类型（0市价单、1限价单、2强平单）
     */
    @ApiModelProperty(value = "类型（0市价单、1限价单、2强平单）", required = true)
    @NotBlank(message = "数据异常，type为空")
    private String type;

    /**
     * 仓位模式（0逐仓、1全仓）
     */
    @ApiModelProperty(value = "仓位模式（0逐仓、1全仓）", required = true)
    @NotBlank(message = "数据异常，positionMode为空")
    private String positionMode;

    /**
     * 方向（0做多、1做空）
     */
    @ApiModelProperty(value = "方向（0做多、1做空）", required = true)
    @NotBlank(message = "数据异常，side为空")
    private String side;

    /**
     * 价格，限价单时不能为空
     */
    @ApiModelProperty(value = "价格，限价单时不能为空")
    private BigDecimal price;

    /**
     * 数量
     */
    @ApiModelProperty(value = "数量", required = true)
    @NotNull(message = "数据异常，num为空")
    private BigDecimal num;

    /**
     * 倍数
     */
    @ApiModelProperty(value = "倍数", required = true)
    @NotNull(message = "数据异常，multiple为空")
    @Min(value = 1, message = "数据异常，multiple不能小于1")
    private Integer multiple;

    /**
     * 是否止盈（0否、1是）
     */
    @ApiModelProperty(value = "是否止盈（0否、1是）")
    private String hasStopProfit;

    /**
     * 止盈触发价格，是否止盈为是时不能为空
     */
    @ApiModelProperty(value = "止盈触发价格，是否止盈为是时不能为空")
    private BigDecimal stopProfitTrigger;

    /**
     * 止盈价格类型（0市价、1限价），是否止盈为是时不能为空
     */
    @ApiModelProperty(value = "止盈价格类型（0市价、1限价），是否止盈为是时不能为空")
    private String stopProfitType;

    /**
     * 止盈价格，止盈价格类型为限价时不能为空
     */
    @ApiModelProperty(value = "止盈价格，止盈价格类型为限价时不能为空")
    private BigDecimal stopProfitPrice;

    /**
     * 是否止损（0否、1是）
     */
    @ApiModelProperty(value = "是否止损（0否、1是）")
    private String hasStopLost;

    /**
     * 止损触发价格，是否止损为是时不能为空
     */
    @ApiModelProperty(value = "止损触发价格，是否止损为是时不能为空")
    private BigDecimal stopLostTrigger;

    /**
     * 止损价格类型（0市价、1限价），是否止损为是时不能为空
     */
    @ApiModelProperty(value = "止损价格类型（0市价、1限价），是否止损为是时不能为空")
    private String stopLostType;

    /**
     * 止损价格，止损价格类型为限价时不能为空
     */
    @ApiModelProperty(value = "止损价格，止损价格类型为限价时不能为空")
    private BigDecimal stopLostPrice;
}
